Add support for Oracle Solaris #2176
Conversation
src/detection/zpool/zpool.c
Outdated
| FFlist* result; | ||
| } FFZfsData; | ||
|
|
||
| static inline int ff_zpool_get_prop_wrapper( |
There was a problem hiding this comment.
I prefer #define ffzpool_get_prop(data, zhp, prop, buf, len, srctype, literal) ffzpool_get_prop(data, zhp, prop, buf, len, srctype)
There was a problem hiding this comment.
@CarterLi
Do you mean that I should replace the wrapper function with a macro, or did I misunderstand you?
P.S. I apologise for my language, I am not a native speaker
There was a problem hiding this comment.
Something like this?:
#if defined(__sun) && !defined(__illumos__)
#define FF_ZPOOL_GET_PROP(data, zhp, prop, buf, len, srctype, literal) \
(data)->ffzpool_get_prop(zhp, prop, buf, len, srctype)
#else
#define FF_ZPOOL_GET_PROP(data, zhp, prop, buf, len, srctype, literal) \
(data)->ffzpool_get_prop(zhp, prop, buf, len, srctype, literal)
#endifThere was a problem hiding this comment.
#if defined(__sun) && !defined(__illumos__)
#define ffzpool_get_prop(data, zhp, prop, buf, len, srctype, literal) \
ffzpool_get_prop(zhp, prop, buf, len, srctype)
#endif
There was a problem hiding this comment.
I fix it, thank. It's default way in C?
Also fix copilot review
There was a problem hiding this comment.
There is no default way. It is my personal preference because of less code.
There was a problem hiding this comment.
Pull request overview
Adds Oracle Solaris build compatibility by introducing small compatibility shims for API/stdlib differences while preserving illumos behavior.
Changes:
- Add a Solaris-specific wrapper for
zpool_get_propto handle the missingboolean_t literalparameter in Solaris headers. - Provide a fallback
memrchrimplementation for Solaris and wire it into the SunOS build. - Update README to list Solaris as a supported platform.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/detection/zpool/zpool.c |
Adds zpool_get_prop wrapper to handle Solaris vs illumos/OpenZFS signature differences |
src/detection/gpu/gpu_pci.c |
Includes Solaris memrchr declaration when building on Solaris |
src/common/solaris/memrchr.h |
Declares memrchr for Solaris builds |
src/common/solaris/memrchr.c |
Implements memrchr fallback for Solaris |
CMakeLists.txt |
Adds memrchr.c to the SunOS source list |
README.md |
Mentions Solaris support in the supported platforms list |
src/detection/zpool/zpool.c
Outdated
| char *buf, | ||
| size_t len, | ||
| zprop_source_t *srctype, | ||
| boolean_t literal __attribute__((unused)) | ||
| ) |
There was a problem hiding this comment.
literal is marked unused via a GCC-style __attribute__((unused)) in the parameter list. The codebase already has FF_MAYBE_UNUSED / FF_UNUSED(...) helpers (see src/common/unused.h) which keeps unused-parameter handling consistent and avoids attribute usage in signatures. Consider switching to FF_MAYBE_UNUSED boolean_t literal (or dropping the attribute and calling FF_UNUSED(literal) in the Solaris branch).
README.md
Outdated
| [](README-cn.md) | ||
|
|
||
| Fastfetch is a [neofetch](https://github.com/dylanaraps/neofetch)-like tool for fetching system information and displaying it in a visually appealing way. It is written mainly in C, with a focus on performance and customizability. Currently, it supports Linux, macOS, Windows 7+, Android, FreeBSD, OpenBSD, NetBSD, DragonFly, Haiku, and illumos (SunOS). | ||
| Fastfetch is a [neofetch](https://github.com/dylanaraps/neofetch)-like tool for fetching system information and displaying it in a visually appealing way. It is written mainly in C, with a focus on performance and customizability. Currently, it supports Linux, macOS, Windows 7+, Android, FreeBSD, OpenBSD, NetBSD, DragonFly, Haiku, illumos (SunOS) and Solaris. |
There was a problem hiding this comment.
The platform list reads a bit ungrammatically as a comma-separated list: "..., Haiku, illumos (SunOS) and Solaris." Consider adding a comma before the final "and" to keep the list consistent and easier to read (", illumos (SunOS), and Solaris").
| Fastfetch is a [neofetch](https://github.com/dylanaraps/neofetch)-like tool for fetching system information and displaying it in a visually appealing way. It is written mainly in C, with a focus on performance and customizability. Currently, it supports Linux, macOS, Windows 7+, Android, FreeBSD, OpenBSD, NetBSD, DragonFly, Haiku, illumos (SunOS) and Solaris. | |
| Fastfetch is a [neofetch](https://github.com/dylanaraps/neofetch)-like tool for fetching system information and displaying it in a visually appealing way. It is written mainly in C, with a focus on performance and customizability. Currently, it supports Linux, macOS, Windows 7+, Android, FreeBSD, OpenBSD, NetBSD, DragonFly, Haiku, illumos (SunOS), and Solaris. |
Also change README.md
Summary
Add support for Oracle Solaris
Related issue (required for new logos for new distros)
Fix #2173
Changes
Checklist
I tested on my Oracle Solaris (uname:
SunOS LISESOLARIS 5.11 11.4.81.193.1 sun4v sparc sun4v non-virtualized)I also tested on OmniOS VM (uname:
SunOS OmniOS-dev 5.11 omnios-r151056-128de81dcd i86pc i386 i86pc)I also tested on Linux
Tested by building and running fastfetch with default configuration.
P.S. I am Python developer, and if you see some wrong with style or other please say me